<?xml version='1.0' encoding='UTF-8' ?>
<!DOCTYPE html PUBLIC "-//W3C//DTD XHTML 1.0 Transitional//EN" "http://www.w3.org/TR/xhtml1/DTD/xhtml1-transitional.dtd">
<html xmlns="http://www.w3.org/1999/xhtml"
      xmlns:h="http://java.sun.com/jsf/html"
      xmlns:f="http://java.sun.com/jsf/core"
      xmlns:p="http://primefaces.org/ui">
    <h:head>
        <style>
        
        </style>
        
        </h:head>
    <h:body>
       <div id="col-top"></div>
    <div id="col" >
       
        <h:outputText value="#{msg['label.descrip.compania']}"/>
        <p:inputText required="true" label="#{msg['label.descrip.compania']}" value="#{beancontroler_.descripcioncompania}" style="width:  500px;margin-left: 1%"/><br/><br/>
        <p:commandButton style="margin-left: 21%;" rendered="#{beancontroler_.permisocreate}" disabled="#{beancontroler_.rederedservicesadd}" icon="ui-icon-plusthick " update="@form" action="#{beancontroler_.agregarcompania()}" value="#{msg['label.add_company']}"/>
        <p:commandButton style="margin-left: 1%;"  update="@form" rendered="#{beancontroler_.permisodelte}" disabled="#{beancontroler_.renderedservicesdelete}" action="#{beancontroler_.eliminarcompania()}"    id="viewCommand" value="#{msg['label.delete_company']}" icon="ui-icon-trash" />
        <p:commandButton style="margin-left: 1%;"  update="@form" rendered="#{beancontroler_.permisoupdate}" disabled="#{beancontroler_.renderedservicesupdate}" icon="ui-icon-disk "  action="#{beancontroler_.actualizarcompania()}"   id="updateco" value="#{msg['label.update_company']}"  /><br/><br/>
          
        <p:inputText id="serch"  style="width: 570px;margin-left: 21%;background-image: url('icons/zoom.png');background-repeat: no-repeat;padding: 3px 3px 3px 25px; background-position: 4px 1px;    " value="#{beancontroler_.filltext}">
            <p:ajax event="keyup" update="dataTable" listener="#{beancontroler_.filtertablecompania()}" />  
        </p:inputText>
        <p:dataTable   paginatorPosition="bottom" rowKey="#{comp.id}" selection="#{beancontroler_.selectedcompania}"  selectionMode="single" style="width:600px;margin-left: 21%;" id="dataTable" var="comp" value="#{beancontroler_.companialista}"  
                 paginator="true" rows="10"  
                 paginatorTemplate="{CurrentPageReport}  {FirstPageLink} {PreviousPageLink} {PageLinks} {NextPageLink} {LastPageLink} {RowsPerPageDropdown}"  
                 rowsPerPageTemplate="5,10,15">  
            <p:ajax event="rowSelect"   update="@none"  oncomplete="updateContent()"   listener="#{beancontroler_.modificompania()}"/>
        <f:facet name="header">  
         #{msg['label.list.companycell']}
        </f:facet>  
  
        <p:column>  
            <f:facet name="header">  
                <h:outputText value="#{msg['label.description_serv']}" />  
            </f:facet>  
            <h:outputText value="#{comp.descripcion}" />  
        </p:column>  
  
    </p:dataTable>  
        
        
        
        
        
       
    
    </div> <!-- /col -->
    <div id="col-bottom"></div>
    </h:body>
</html>
